/**
 * de.herberlin.sudoku.FieldImpl
 */
package de.herberlin.sudoku.test;

import java.awt.Point;
import java.io.Serializable;

import de.herberlin.sudoku.Constants;
import de.herberlin.sudoku.Field;
import de.herberlin.sudoku.Sudoku;

/**
 * Class represents a single field on the sudoko
 * playground
 * @author herberlin
 * @created 30.05.2006
 */
public class FieldImpl extends Point implements Serializable,Cloneable, Field {

	private boolean mutable=true;
	private Sudoku sudoku=null;

	/**
	 * Current value
	 */
	private int value=Constants.INT_NOT_SET;


	public FieldImpl(int x, int y) {
		super(x,y);
	}
	/* (non-Javadoc)
	 * @see de.herberlin.sudoku.Field#getValue()
	 */
	public int getValue() {
		return value;
	}

	/* (non-Javadoc)
	 * @see de.herberlin.sudoku.Field#setValue(int)
	 */
	public void setValue(int currentValue) {
		this.value = currentValue;
	}

	/* (non-Javadoc)
	 * @see de.herberlin.sudoku.Field#isMutable()
	 */
	public boolean isMutable() {
		return mutable;
	}

	/* (non-Javadoc)
	 * @see de.herberlin.sudoku.Field#setMutable(boolean)
	 */
	public void setMutable(boolean modifiable) {
		this.mutable = modifiable;
	}

	public String toString() {
		return "["+getX()+","+getY()+", value="+getValue()+"]";
	}

	public Object clone() {
		return super.clone();
	}

	public int getXPos() {
		return this.x;
	}
	public int getYPos() {
		return this.y;
	}
	public void setSudoku(Sudoku sudoku) {
		this.sudoku=sudoku;

	}
	public Sudoku getSudoku() {
		return sudoku;
	}
	public void setResolved() {
		// TODO Auto-generated method stub

	}
	public void setSuccess() {
		// TODO Auto-generated method stub

	}
}
